package com.event.ingestion.data.hbase;

import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.util.Bytes;

public class EventAttendeesParser extends com.event.ingestion.data.EventAttendeesParser<Put> {
    @Override
    public Put parse(String[] fields) {
        Put p = new Put(Bytes.toBytes((fields[0] + "." + fields[1] + "-" + fields[2]).hashCode()));  //rowkey

        p.addColumn(Bytes.toBytes("euat"),Bytes.toBytes("event_id"),Bytes.toBytes(fields[0]));
        p.addColumn(Bytes.toBytes("euat"),Bytes.toBytes("user_id"),Bytes.toBytes(fields[1]));
        p.addColumn(Bytes.toBytes("euat"),Bytes.toBytes("attend_type"),Bytes.toBytes(fields[2]));

        return p;
    }
}
